C1.WPF.LiveLinq Namespace > WpfExtensions Class > ToIndexed Method : ToIndexed<T>(INotifyCollectionChanged) Method |
'Declaration
Public Overloads Shared Function ToIndexed(Of T)( _ ByVal source As System.Collections.Specialized.INotifyCollectionChanged _ ) As IndexedCollection(Of T)
public static IndexedCollection<T> ToIndexed<T>( System.Collections.Specialized.INotifyCollectionChanged source )
Use this method to index and query your existing data sources implementing System.Collections.Specialized.INotifyCollectionChanged. The element type of this data source must implement System.ComponentModel.INotifyPropertyChanged, see Using the built-in collection class IndexedCollection(T) (LiveLinq to Objects)|tag=Using_the_built_in_collection_class_IndexedCollectionT_LiveLinq_to_Objects.
The collection returned by this method also implements the System.Collections.Specialized.INotifyCollectionChanged interface, because this method actually returns objects of an internal derived class that implements that interface.
Note: Indexes created on the resulting C1.LiveLinq.Collections.IndexedCollection<T> are owned by it and not by the original data source. Every ToIndexed() call creates a separate object that has its own separate indexes. Avoid calling ToIndexed() repeatedly for the same collection because it can increase the cost of maintaining indexes.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2